package Otros;
import org.orm.PersistentException;
import org.orm.PersistentTransaction;


import orm.BdAnotacionesPersistentManager;

public class CreateSubsectorData {
int a=1;

	public void createTestData() throws PersistentException {
        PersistentTransaction t = BdAnotacionesPersistentManager.instance().getSession().beginTransaction();
        try {
                orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
                orm.dao.Tan_subsectorDAO lormTan_subsectorDAO = lDAOFactory.getTan_subsectorDAO();
                orm.dao.Tan_cursoDAO lormTan_cursoDAO = lDAOFactory.getTan_cursoDAO();
                orm.Tan_subsector lormTan_subsector = lormTan_subsectorDAO.createTan_subsector();
                
                orm.Tan_curso lormTan_curso = lormTan_cursoDAO.getTan_cursoByORMID(a);
        
               
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                
                lormTan_subsector.setSu_descripcion("Matematicas");
               
                lormTan_subsector.setTan_cursocu(lormTan_curso );
				
                lormTan_subsectorDAO.save(lormTan_subsector);
                
               orm.Tan_curso lormTan_curso2 = lormTan_cursoDAO.getTan_cursoByORMID(a+1); 
               orm.Tan_subsector lormTan_subsector2 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
               lormTan_subsector2.setSu_descripcion("Matematicas");
              
                lormTan_subsector2.setTan_cursocu(lormTan_curso2 );
                lormTan_subsectorDAO.save(lormTan_subsector2);
                
                orm.Tan_curso lormTan_curso3 = lormTan_cursoDAO.getTan_cursoByORMID(a+2); 
                orm.Tan_subsector lormTan_subsector3 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector3.setSu_descripcion("Matematicas");
               
                lormTan_subsector3.setTan_cursocu(lormTan_curso3 );
                lormTan_subsectorDAO.save(lormTan_subsector3);
                
                orm.Tan_curso lormTan_curso4 = lormTan_cursoDAO.getTan_cursoByORMID(a+3);
                orm.Tan_subsector lormTan_subsector4 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector4.setSu_descripcion("Matematicas");
               
                lormTan_subsector4.setTan_cursocu(lormTan_curso4 );
                lormTan_subsectorDAO.save(lormTan_subsector4);
                
                orm.Tan_curso lormTan_curso5 = lormTan_cursoDAO.getTan_cursoByORMID(a+4);
                orm.Tan_subsector lormTan_subsector5 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector5.setSu_descripcion("Matemtacias");
                
                lormTan_subsector5.setTan_cursocu(lormTan_curso5 );
                lormTan_subsectorDAO.save(lormTan_subsector5);
                
                
                orm.Tan_subsector lormTan_subsector6 = lormTan_subsectorDAO.createTan_subsector();
                orm.Tan_curso lormTan_curso6 = lormTan_cursoDAO.getTan_cursoByORMID(a);
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector6.setSu_descripcion("Lenguaje");
                
                lormTan_subsector6.setTan_cursocu(lormTan_curso6 );
                lormTan_subsectorDAO.save(lormTan_subsector6);
                
                orm.Tan_curso lormTan_curso7 = lormTan_cursoDAO.getTan_cursoByORMID(a+1);
                orm.Tan_subsector lormTan_subsector7 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector7.setSu_descripcion("Lenguaje");
               
                lormTan_subsector7.setTan_cursocu(lormTan_curso7 );
                lormTan_subsectorDAO.save(lormTan_subsector7);
                
                orm.Tan_curso lormTan_curso8 = lormTan_cursoDAO.getTan_cursoByORMID(a+2);
                orm.Tan_subsector lormTan_subsector8 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector8.setSu_descripcion("Lenguaje");
                
                lormTan_subsector8.setTan_cursocu(lormTan_curso8 );
                lormTan_subsectorDAO.save(lormTan_subsector8);
                
                orm.Tan_curso lormTan_curso9 = lormTan_cursoDAO.getTan_cursoByORMID(a+3);
                orm.Tan_subsector lormTan_subsector9 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector9.setSu_descripcion("Lenguaje");
               
                lormTan_subsector9.setTan_cursocu(lormTan_curso9 );
                lormTan_subsectorDAO.save(lormTan_subsector9);
                
                orm.Tan_curso lormTan_curso10 = lormTan_cursoDAO.getTan_cursoByORMID(a+4);
                orm.Tan_subsector lormTan_subsector10 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector10.setSu_descripcion("Lenguaje");
               
                lormTan_subsector10.setTan_cursocu(lormTan_curso10 );
                lormTan_subsectorDAO.save(lormTan_subsector10);
                
                
                orm.Tan_curso lormTan_curso11 = lormTan_cursoDAO.getTan_cursoByORMID(a);
                orm.Tan_subsector lormTan_subsector11 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector11.setSu_descripcion("Ingles");
               
                lormTan_subsector11.setTan_cursocu(lormTan_curso11 );
                lormTan_subsectorDAO.save(lormTan_subsector11);
                
                orm.Tan_curso lormTan_curso12 = lormTan_cursoDAO.getTan_cursoByORMID(a+1);
                orm.Tan_subsector lormTan_subsector12 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector12.setTan_cursocu(lormTan_curso12 );
                lormTan_subsector12.setSu_descripcion("Ingles");
                
                
                lormTan_subsectorDAO.save(lormTan_subsector12);
                
                orm.Tan_curso lormTan_curso13 = lormTan_cursoDAO.getTan_cursoByORMID(a+2);
                orm.Tan_subsector lormTan_subsector13 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector13.setSu_descripcion("Ingles");
               
                lormTan_subsector13.setTan_cursocu(lormTan_curso13 );
                
                lormTan_subsectorDAO.save(lormTan_subsector13);
                
                orm.Tan_curso lormTan_curso14 = lormTan_cursoDAO.getTan_cursoByORMID(a+3);
                orm.Tan_subsector lormTan_subsector14 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector14.setSu_descripcion("Ingles");
                
                lormTan_subsector14.setTan_cursocu(lormTan_curso14 );
                
                lormTan_subsectorDAO.save(lormTan_subsector14);
                
                orm.Tan_curso lormTan_curso15 = lormTan_cursoDAO.getTan_cursoByORMID(a+4);
                orm.Tan_subsector lormTan_subsector15 = lormTan_subsectorDAO.createTan_subsector();
                // TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : tda_anotacion, tan_nombre
                lormTan_subsector15.setSu_descripcion("Ingles");
               
                lormTan_subsector15.setTan_cursocu(lormTan_curso15 );
                
                lormTan_subsectorDAO.save(lormTan_subsector15);
                
                
                
                
                t.commit();
        }
        catch (Exception e) {
                t.rollback();
        }
        
}

public static void main(String[] args) {
        try {
     	   CreateSubsectorData CreateData = new CreateSubsectorData();
                
                try {
                        CreateData.createTestData();
                }
                finally {
                        orm.BdAnotacionesPersistentManager.instance().disposePersistentManager();
                }
        }
        catch (Exception e) {
                e.printStackTrace();
        }
}
}

